package com.listener;

import java.util.ArrayList;
import java.util.List;



public class AccountConflictMonitor {

	private List<onAccountConflictListener> mListeners = new ArrayList<onAccountConflictListener>();

	public void addAccountConflictListener(onAccountConflictListener listener) {
		if(listener==null) return;
		mListeners.add(listener);
	}

	public void removeAccountConflictListener(onAccountConflictListener listener) {
		if(listener==null) return;
		mListeners.remove(listener);
	}
    
	public void noticeObservers(){
					int size = mListeners.size();
					for (int i = 0; i < size; i++) {
						onAccountConflictListener listener = mListeners.get(i);
						if (listener != null) {
							listener.onAccountConflict();
						}
					}
	}
	
	public void destroy(){
		   mListeners.clear();
		   mListeners=null;
	}
	
	public static interface onAccountConflictListener{
		   public void onAccountConflict();
	}

}
